<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <link href="./Public/Home/Css/public.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="./Public/Home/font/iconfont.css">
    <script src="./Public/Admin/Js/jquery.js"></script>
    <title>博文内容页</title>
    <script>
        //发送ajax请求获取评论数据，将返回的提示信息封装到模态框中显示
        function commit() {
            let data = $("#form1").serialize();
            $.post("?c=Index&a=saveComment", data, (message) => {
                $("#tipsMsg").html(message);
                $("#showMessage").show(500);
                setTimeout(() => {
                    $("#showMessage").hide(600);
                    location.reload();
                }, 1000)
            })
        }

        //发送ajax请求获取点赞数据，将返回的提示信息封装到模态框中显示
        function praise(id) {
            $.get("?c=Index&a=praise&id="+id, (message) => {
                $("#tipsMsg").html(message);
                $("#showMessage").show(500);
                setTimeout(() => {
                    $("#showMessage").hide(600);
                    location.reload();
                }, 1000)
            })
        }
    </script>
</head>

<body>
<div class="bottombg">
    <!--项部导航栏-->
    <div class="topbar">
        <div class="content">
            <div class="divL">
                <i><a href="javascript:void(0)"><span class="iconfont icon-faxian-copy"></span>设为首页</a></i>
                <a href="javascript:void(0)"><span class="iconfont icon-shoucang"></span>加入收藏</a>
            </div>
            <div class="divR">
                <{if !empty($smarty.session.username)}>
                <span><span class="iconfont icon-huanyingye"></span>欢迎，<span
                        style="color:red"><{$smarty.session.username}></span></span>
                <a href="admin.php"><span class="iconfont icon-houtaiweihu"></span>后台管理</a>
                <a href="admin.php?c=User&a=logout"><span class="iconfont icon-tuichu1"></span>退出管理</a>
                <{else}>
                <span>欢迎光临我的小博客！</span>
                <a href="admin.php?c=User&a=login">后台登录</a>
                <{/if}>
            </div>
        </div>
    </div><!--//顶部导航栏-->

    <!--博客背景-->
    <div class="blogbg">
        <div class="header">
            <div class="title">
                <h2>CodeRecently的博客</h2>
                <p><a href="javascript:void(0)">http://blog.huaxin.press/index.php</a></p>
            </div>
            <div class="menu">
                <ul>
                    <li><a href="index.php" class="current">首页</a></li>
                    <li><a href="index.php?c=Index&a=showList">博文目录</a></li>
                    <li><a href="javascript:void(0)">图片</a></li>
                    <li><a href="index.php?c=Index&a=showMyMsg" class="noLine">关于我</a></li>
                </ul>
            </div>
        </div>
    </div><!--//博客背景-->

    <!--博客主体-->
    <div class="contains">
        <!--左边栏-->
        <div class="left">
            <div class="toptitle">博文正文</div>
            <!--博文正文-->
            <div class="blogdetail">
                <div class="title">
                    <a href="javascript:void(0)"><{$article.title}></a>
                    <span>(<{$article.addate|date_format:'%Y-%m-%d %H:%M:%S'}>)</span>
                </div>
                <div class="content">
                    <{$article.content}>
                </div>
                <div class="bottom">
                    <!--页面分享代码-->
                    <div class="bdsharebuttonbox">
                        <a href="#" class="bds_more" data-cmd="more"></a>
                        <a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
                        <a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
                        <a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a>
                        <a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网"></a>
                        <a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
                    </div>

                    <!--页面分享代码-->
                    <script>window._bd_share_config = {
                        "common": {
                            "bdSnsKey": {},
                            "bdText": "",
                            "bdMini": "2",
                            "bdMiniList": false,
                            "bdPic": "",
                            "bdStyle": "0",
                            "bdSize": "16"
                        },
                        "slide": {"type": "slide", "bdImg": "7", "bdPos": "right", "bdTop": "67.5"},
                        "image": {
                            "viewList": ["qzone", "tsina", "tqq", "renren", "weixin"],
                            "viewText": "分享到：",
                            "viewSize": "16"
                        },
                        "selectShare": {
                            "bdContainerClass": null,
                            "bdSelectMiniList": ["qzone", "tsina", "tqq", "renren", "weixin"]
                        }
                    };
                    with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];
                    </script>

                    <!--//页面分享代码-->
                    <div class="other">
                        作者:<{$article.name}> |
                        分类:<{$article.classname}> |
                        阅读:<{$article.read}> |
                        <a href="javascript:void(0)" onclick="praise('<{$article.id}>')">点赞:<{$article.praise}></a> |
                        评论:<{$article.comment_count}>
                    </div>
                </div>


                <!--分页代码-->
                <div class="pagelist2">
                    <ul>
                        <li>前一篇：
                            <{if !empty($prevNext[0])}>
                            <a href="?c=Index&a=content&id=<{$prevNext[0]['id']}>"><{$prevNext[0]['title']}></a>
                            <{else}>
                            没有啦！
                            <{/if}>
                        </li>
                        <li>后一篇：
                            <{if !empty($prevNext[1])}>
                            <a href="?c=Index&a=content&id=<{$prevNext[1]['id']}>"><{$prevNext[1]['title']}></a>
                            <{else}>
                            没有啦！
                            <{/if}>
                        </li>
                    </ul>
                </div><!--//分页代码-->
            </div><!--//博客主体-->

            <!--评论-->
            <div class="comment">
                <div class="title">评论列表</div>
                <!--主评论内容-->
                <ul class="ul01">
                    <{foreach $currentComments as $currentComment}>
                    <{if $currentComment@iteration<=3}>
                    <li>
                        <p class="p1">
                            <img src="./Public/Home/Images/head.png">
                            <b><a href="#"><{$currentComment.name}></a><{$currentComment.addate|date_format:'%Y-%m-%d
                                %H:%M:%S'}></b>
                            <a href="javascript:void(0)">回复</a>
                        </p>
                        <p class="p2"><{$currentComment.content}></p>
                    </li>
                    <{/if}>
                    <{/foreach}>
                </ul>
                <!--//主评论内容-->
                <form id="form1" style="text-align: center" name="comment" method="post"
                      action="">
                    <h4>发表评论</h4>
                    <textarea name="content" style="width:95%;height:150px;"></textarea>
                    <input type="hidden" name="article_id" value="<{$article.id}>">
                    <input type="hidden" name="pid" value="0">
                    <br><input style="width: 60px;" type="button" value="提交" onclick="commit()"/>
                </form>
            </div><!--//评论-->
        </div><!--//左边栏-->
        <!--右边栏-->
        <div class="right">
            <!--文章标题搜索-->
            <div class="search">
                <div class="title">文章标题搜索</div>
                <div class="content">
                    <form name="form1" method="post" action="?c=Index&a=index">
                        <input class="search" type="text" name="keyword">
                        <input type="submit" value="搜索">
                    </form>
                </div>
            </div><!--//文章标题搜索-->
            <!--文章分类-->
            <div class="category">
                <div style="text-align: center" class="title">文章分类</div>
                <div class="content">
                    <ul>
                        <{foreach $categorys as $category}>
                        <li><a href="?c=Index&a=index&category_id=<{$category.id}>">
                            <{str_repeat('--',$category.level*2)}>
                            <{$category.classname}></a>
                            (<span style="color: red"><{$category.article_count}></span>)
                        </li>
                        <{/foreach}>
                    </ul>
                </div>
            </div><!--//文章分类-->
            <!--最新评论-->
            <div class="comment">
                <div style="text-align: center" class="title">最新评论</div>
                <div class="content">
                    <ul>
                        <{foreach $showComments as $showComment}>
                        <{if $showComment@iteration<=4}>
                        <li>
                            <div>
                                <{$showComment.name}><span><{$showComment.addTime|date_format:'%Y-%m-%d %H:%M:%S'}></span>
                            </div>
                            <a href="javascript:void(0)"
                               style=" width:100%;white-space: nowrap;overflow:hidden;display: inline-block;text-overflow: ellipsis">
                                <{$showComment.content}></a>
                        </li>
                        <{/if}>
                        <{/foreach}>
                    </ul>
                </div>
            </div><!--//最新评论-->
            <!--文章归档-->
            <div class="category-date">
                <div style="text-align: center" class="title">文章归档</div>
                <div class="content">
                    <ul>
                        <{foreach $months as $month}>
                        <li><a href="javascript:void(0)"><{$month.yearmonth}></a>
                            (<span style="color:red;"><{$month.article_count}></span>)
                        </li>
                        <{/foreach}>
                    </ul>
                </div>
            </div><!--//文章归档-->
            <!--友情链接-->
            <div class="links">
                <div style="text-align: center" class="title">友情链接</div>
                <div class="content">
                    <ul>
                        <{foreach $links as $link}>
                        <li><a target="_blank" href="<{$link.url}>"><{$link.domain}></a></li>
                        <{/foreach}>
                    </ul>
                </div>
            </div><!--//友情链接-->
        </div><!--//右边栏-->
        <div class="clear"></div>

    </div><!--//博文正文-->

    <!--网页底部-->
    <div class="footer">
        Copyright&copy 2020年2月13日 SunQiXin 鲁ICP备20005824号<br/>电话：15153869872 邮箱: 15153869872@163.com
    </div><!--//网页底部-->
</div>
<!--  模态对话框-->
<div id="showMessage"><br>
    <div id="myToast">
        <div class="toast-header">
            <img src="./Public/Admin/Images/huaxin.png" alt="" width="30">
            <strong>提示</strong>
            <small>1分钟前</small>
            <button>&times;</button>
        </div>
        <div id="tipsMsg">
            注册成功！
        </div>
    </div>
</div>
<!--  模态对话框-->
</body>
</html>
